<!DOCTYPE html>
<html>
<head>
	<#include "/pages/templet/head.html"/>
	<SCRIPT type="text/javascript">
		var setting = {
			data: {
				simpleData: {
					enable: true
				}
			},
			callback: {
				//onCollapse: alert("up"),
				onExpand: function(){
					if (treeNiceScroll) {
						treeNiceScroll.resize();
					}
				}
			},
			view: {
				showLine: false
			}
		};
		//菜单点击
		function treeclick(id,url){
			//设置权限
			//loadURL(url,"_self",null);
		}
		var zNodes1 =[
			{ id:"0", pId:"0", name:"<#if tabid?? && tabid == 'pub'>公共文件夹<#elseif tabid?? && tabid='pri'>个人文件夹</#if>", open:true ,onclick:treeclick("0","/${orgi}/user/${tabid}/tabindex.html"), url:"/${orgi}/user/${tabid}/tabindex.html",icon:"/assets/images/icon-file-closed.png", target:"_self"}
			<#if dicList??>
			<#list dicList as dic>
			<#if dic.isAllow('1', user) == true>
			,{ id:"${dic.id!''}", pId:"${dic.parentid!''}", name:"${dic.name!''}", icon:"/assets/images/icon-file-closed.png",url:"/${orgi}/user/${tabid}/reportdic/${dic.id!''}.html" , target:"_self"}
			</#if>
			</#list>
			<#if tabid?? && tabid == 'pri'>
			,{ id:"1", pId:"1", name:"我的报表" , open: true, icon:"/assets/images/icon-file-closed.png"}
			,{ id:"create", pId:"1", name:"我创建的报表", icon:"/assets/images/icon-file-closed.png",url:"/${orgi}/user/pri/reportdic/create.html" , target:"_self"}
			,{ id:"save", pId:"1", name:"我保存的报表", icon:"/assets/images/icon-file-closed.png",url:"/${orgi}/user/pri/reportdic/save.html" , target:"_self"}
			</#if>
			</#if>
		];
		$(document).ready(function(){
			var ztree = $.fn.zTree.init($(document.getElementById("zTree_adminLIst")), setting, zNodes1);
			ztree.selectNode(ztree.getNodeByParam("id", "${parentid!''}", null));
			
		});
		function submitExportForm(){
			$("#mainForm").attr("action","/${orgi}/user/report/${tabid}/${parentid!''}/reportdownload.html");
			$("#mainForm").submit();
			//导出状态回执到初始状态；			
			$("input[name$='IsExport']").val(1);	
		}
		
		function submitMoveForm(){
			$("#mainForm").attr("action","/${orgi}/user/report/${tabid}/reportmovelist.html");
			$("#mainForm").submit();
		}
		function submitCopyForm(){
			$("#mainForm").attr("action","/${orgi}/user/report/${tabid}/reportcopylist.html");
			$("#mainForm").submit();
		}
		function submitDelForm(){
			if($("input[name='reportids']:checked").length>0){
				art.confirm('您确定要删除这些报表吗？' 
				, function(){
					$("#mainForm").attr("action","/${orgi}/user/report/${tabid}/${parentid!''}/reportdellist.html");
					$("#mainForm").submit();
				
				} 
				, function(){})
				
			}else{
				alertMsg("请选择要删除的报表！");
			}
			
		}
		function submitTaskAddForm(){
			$("input[reportType!='report']").attr("checked",false);
			if($("input[name='reportids']:checked").length>0){
				$("#taskadd").click();
			}else{
				alertMsg("请选择要操作的报表！");
			}
		}
		
		function reportExportCheck(){
			$("input[reportType!='report']").attr("checked",false);
			$("#reportExport").click();
		}
		
		function reportTaskExport(){
			$("input[reportType!='plan']").attr("checked",false);
			if($("input[name='reportids']:checked").length>0){
				$("#mainForm").attr("action","/${orgi}/user/report/${tabid}/${parentid!''}/taskdownload.html");
				$("#mainForm").submit();
			}else{
				alertMsg("请选择要操作的计划任务！");
			}
		}
		
		function submitReportDoForm(id){
			$("input[reportType!='report']").attr("checked",false);
			if($("input[name='reportids']:checked").length>0){
				$("#"+id).click();
			}else{
				alertMsg("请选择要操作的报表！");
			}
		}
		
		
		
		function exportFormDataDo(type,obj,ref){
			var isExport = $(obj).prop("checked")?"1":"0"; 
			$("#"+type+"IsExport").val(isExport);	
		}
		
		function morePannelMgr(id){
			$(".morefloat").css("display","none");
			$("#ul"+id).css("margin-left","-55px");
			$("#ul"+id).css("display","block");
			
		}
		    
	   function addfavorite(id,name)
		{
			var url="http://"+window.location.host+"/${orgi}/user/report/view/"+id+".html";  
		   	var title=name+"报表";
		   if (document.all){
		      window.external.addFavorite(url,name+'_________报表收藏');
		   }
		   else{
		    	alert("\u5bf9\u4e0d\u8d77\uff0c\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u6b64\u64cd\u4f5c!\n\u8bf7\u60a8\u4f7f\u7528\u83dc\u5355\u680f\u6216Ctrl+D\u6536\u85cf\u672c\u7ad9\u3002");
		   }
		} 
		     
		
	</SCRIPT>

</head>
<body>
<div class="container rs_layout" wrapper="true"><!-- Everything started here -->
	<div class="rs_layout_top" style="height:65px;">
		<div class="nav_top"><!--NavTop-->
			<#include "/pages/templet/headmenu.html"/>
		</div>
		<ul class="nav_tapWrap">
			<li class="nav_tapIthems <#if tabid?? && tabid == 'pub'>cur</#if>"><a href="/${orgi}/user/index.html"><i class="tabIcon"></i>公共文件夹</a></li>
			<li class="nav_tapIthems <#if tabid?? && tabid == 'pri'>cur</#if>"><a href="/${orgi}/user/pri/tabindex.html"><i class="tabIcon"></i>个人文件夹</a></li>
		</ul>
	</div>
	<div class="rs_layout_center reTabcon">
		<div class="rs_layout rTablayer show">
			<div class="rs_layout_top breadCrumbWrap">
				<div class="breadCrumbStart">您当前的位置是在：</div>
				<ul class="breadCrumb">
					<li class="bc_ithems"><a href="#">报表</a></li>
					<li class="bc_ithems">
						<#if tabid?? && tabid == 'pub'>
							<a href="/${orgi}/user/index.html">公共文件夹</a>
						<#elseif tabid?? && tabid == 'pri'>
							<a href="/${orgi}/user/pri/tabindex.html">个人文件夹</a>
						</#if>
					</li>
					
					<#if locationdics??>
						<#list locationdics?reverse as local>
					<li class="bc_ithems">
						<a href="/${orgi}/user/pub/reportdic/${local.id!''}.html">${local.name!''	}</a>
					</li>	
						</#list>
					</#if>
					
					<!--<a href="/${orgi}/user/index.html"><#if tabid?? && tabid == 'pri'>个人文件夹<#else>公共文件夹</#if></a>
					<li class="bc_ithems"><a href="#">业务报表</a></li>
					<li class="bc_ithems"><a href="#">绩效考核</a></li>
					<li class="bc_ithems"><a href="#">2013年度</a></li>
					<li class="bc_ithems"><a href="#">部门考核</a></li>
					-->
				</ul>
				<ul class="controlButtons">
					<#if dic?? && dic.spsearch == true>
					<li class="searchhbox" style="width:250px;padding:0px;">
						<form action="<#if RequestParameters.type?? && RequestParameters.type == 'all'>/${orgi}/user/${tabid!'pub'}/tabindex.html<#else>/${orgi}/user/${tabid}/reportdic/${parentid!''}.html</#if>" class="header-search" id="searchboxform">
							<span>
								<select name="type" onchange="if($(this).val() == 'all'){$('#searchboxform').attr('action','/${orgi}/user/${tabid!'pub'}/tabindex.html');}else{$('#searchboxform').attr('action','/${orgi}/user/${tabid}/reportdic/${parentid!''}.html');}">
									<option value="all" <#if RequestParameters.type?? && RequestParameters.type == 'all'>selected="selected"</#if>>所有目录</option>
									<option value="dic" <#if RequestParameters.type?? && RequestParameters.type == 'dic'>selected="selected"</#if>>当前目录</option>
								</select>
							</span>
							<span>
								<input type="text" name="name" placeholder="查找报表" id="search-fld" style="padding-right:0px !important;width: 150px;" value="${RequestParameters.name!''}">
								<button type="submit">
									<i class="fa-search"></i>
								</button>
							</span>
						</form>
					</li>
					
					<#if tabid?? && tabid != 'my'>
					<#if currentDicAuth?? && currentDicAuth.isAllow('9' , user) == true && (dic?? && dic.tabtype?? && dic.tabtype == 'pub')>
					<li title="导入报表" class="cbtn-icon-45" href="/${orgi}/user/report/${tabid}/${parentid!''}/reportimport.html" data-width="600" id="dbsourceimport" data-toggle="ajax"></li>
					</#if>
					<!--<li class="cbtn-icon-1"></li>
					<li class="cbtn-icon-2"></li>-->
					<#if currentDicAuth?? && currentDicAuth.isAllow('2' , user) == true>
					<li class="cbtn-icon-3" data-toggle="ajax" id="newdic" data-width="600" data-height="300" href="/${orgi}/user/report/${tabid}/${parentid!''}/reportdicadd.html" title="新建目录"></li>  					
					<#if parentid?? && parentid!="0">
					
					<li class="cbtn-icon-39" id="del" data-width="600" data-height="300" title="删除目录" onclick="art.confirm('您确定删除该目录？' , function(){location.href='/${orgi}/user/report/${tabid}/${parentid!''}/reportdicrm.html';} , function(){})"></li>
					</#if>
					</#if>
					<#if currentDicAuth?? && currentDicAuth.isAllow('3' , user) == true && (dic?? && dic.tabtype?? && dic.tabtype == 'pub')>
					<li class="cbtn-icon-38" data-toggle="ajax" id="edit" data-width="750" href="/${orgi}/user/report/${tabid}/${parentid!''}/reportdicedit.html" title="编辑目录"></li>
					</#if>
					<#if currentDicAuth?? && currentDicAuth.isAllow('8' , user) == true && (dic?? && dic.tabtype?? && dic.tabtype == 'pub')>
					<li class="cbtn-icon-42" onclick="submitTaskAddForm()" title="新建计划任务"></li>  
					<li class="cbtn-icon-42" form="mainForm" data-toggle="ajax-dialog-form" id="taskadd" style="display: none;" data-width="600" href="/${orgi}/user/report/${tabid}/${parentid!''}/taskadd.html" title="新建计划任务"></li>
					</#if>
					<#if currentDicAuth?? && currentDicAuth.isAllow('7' , user) == true>
					<li class="cbtn-icon-4" data-toggle="ajax" id="newreport" data-width="600" data-height="300" href="/${orgi}/user/report/${tabid}/${parentid!''}/reportadd.html" title="新建报表"></li>
					</#if>
					</#if>
					</#if>
				</ul>
			</div>
			<div class="rs_layout_left" resizable="true" style="width:230px;">
				<div class="lftTreeWrap">
					<div class="ztree" id="zTree_adminLIst"></div>
				</div>
			</div>
		<!--<div class="rs_layout_right" style="width:300px;"></div>-->
			<div class="rs_layout_center">
			
				<div class="rs_layout">
					<div class="rs_layout_center">
						<div class="tableScrollWrap">
						<form id="mainForm" action="" data-toggle="form" method="post">
						<input type="hidden" value="0" name="dicid" id="dicid"/>
						<input type="hidden" value="1" name="reportIsExport" id="reportIsExport"/>
						<input type="hidden" value="1" name="cubeIsExport" id="cubeIsExport"/>
						<input type="hidden" value="1" name="dsIsExport" id="dsIsExport"/>
						<input type="hidden" value="1" name="authIsExport" id="authIsExport"/>
						
							<table class="table_style_1">
								<thead>
									<tr>
										<th style="width:30px;"></th>
										<th><i class="verMidWrap">名称</i><i class="tbArrow"></i></th>
										<th class="minSize"><i class="verMidWrap">创建人</i><i class="tbArrow"></i></th>
										<th class="minSize"><i class="verMidWrap">发布状态</i><i class="tbArrow"></i></th>
										<th class="minSize"><i class="verMidWrap">创建时间</i><i class="tbArrow"></i></th>
										<th class="minSize minIsHide"><i class="verMidWrap">修改时间</i><i class="tbArrow"></i></th>
										<th style="text-align:right;" class="minSize">操作</th>
									</tr>
								</thead>
								<tbody>
									
									<#if reportList??>
									<#list reportList as report>       
									<!-- modify by huqi  增加鉴权 -->             
									<#if report.isAllow('1',user) == true>    
										<#if report.reporttype?? && report.reporttype == 'plan' && report.isAllow('8' , user) == false >
										<#else>
										<!-- 如果没有报表权限，不展示该报表 -->                                                                
											<tr>
												<td class="tdIcons"><input reportType="${report.reporttype!''}" type="checkbox" name="reportids" value="${report.id!''}"></td>
												<td>
													<#assign title = ""/>
													<#if report.reporttype?? && report.reporttype == 'plan'>
														<#assign title = "计划任务"/>
														
													<#elseif report.reporttype?? && report.reporttype == 'shortcut'>
														<#assign title = '快捷方式'/>
													<#else>
														<#if report.status??&&report.status == 'available'>
															<#assign title = report.name!''/>
														<#else>
															<#assign title = "报表未发布，当前状态不可用"/>
														</#if>
													</#if>
													<!-- 1读/2编辑/3设置策略/4设计/5执行/6遍历 -->
													<#if report.reporttype?? && report.reporttype == 'plan'>
														<i class="icons_tablelist icons_tablelist_plan" title="${title!''}"></i>${report.name!''}
													<#elseif report.reporttype?? && report.reporttype == 'dicshortcuts'>
														<a <#if report.isAllow("5",user) == true>	href="<#if status??&&report.status == 'unavailable'>/${orgi}/design/query/${report.id!''}.html?t=${.now?long}<#else></#if>"	</#if>
														class="report"
														target="report"	 
														title="${report.name!''}目录的快捷方式">
															<i class="icons_tablelist icons_tablelist_shortcuts"></i>${report.name!''}
														</a>
													<#elseif report.reporttype?? && report.reporttype == 'shortcuts'>
														<a <#if report.isAllow("5",user) == true >	href="/${orgi}/user/report/redirect/${report.id}.html?t=${.now?long}"</#if>	
														class="report"
														target="report"	 
														title="${report.name!''}">
															<i class="icons_tablelist icons_tablelist_reportshortcuts"></i>${report.name!''}
														</a> 
													<#else>
													<a	<#if report.isAllow("5",user) == true> href="
														<#if report.status?? && report.status == 'unavailable'>
															<#if report.rolename?? && report.rolename == "dashboard">
															/${orgi}/design/dashboard/${report.id!''}.html?t=${.now?long}
															<#else>
															/${orgi}/design/query/${report.id!''}.html?t=${.now?long}
															</#if>
														<#else>
															<#if report.rolename?? && report.rolename == "dashboard">
															/${orgi}/user/report/view/${report.id!''}.html?t=${.now?long}
															<#else>
																<#if report.extparam?? && report.extparam='true'>
																	/${orgi}/design/player/${report.id!''}.html?t=${.now?long}
																<#else>
																	/${orgi}/user/report/view/${report.id!''}.html?t=${.now?long}
																</#if>
															</#if>
														</#if>"</#if>	
														class="report"
														target="report"	 
														title="${title!''}">
														<i class="icons_tablelist <#if report.status?? && report.status == 'available'><#if report.rolename?? && report.rolename == 'dashboard'>icons_dashboard<#else>icons_tablelist_available</#if><#else>icons_tablelist_unavailable</#if>
														">
														</i>${report.name!''}</a>

													</#if>
												</td>
												<td class="minSize">${report.username!''}</td>
												<td class="minSize"><#if report?? && report.publishedtype?? && report.publishedtype == "published">已发布<#else>未发布</#if></td>
												<td class="minSize"><#if report.createtime??>${report.createtime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
												<td class="minSize"><#if report.updatetime??>${report.updatetime?string('yyyy-MM-dd HH:mm:ss')}</#if></td>
												<td style="width: 17%;text-align:right;" class="minSize">
													<#if report.reporttype?? && report.reporttype == 'report'>
													<#if report.isAllow("2",user) == true>
													<div onmouseout="$('.morefloat').css('display','none')" style="float: right;margin-right:0px; width: 40px;" class="moremain">
									                    <div class="shtitle" onmouseover="morePannelMgr('${report.id!''}')" style="z-index: 1000;">
									                        <em>
									                            	<a href="javascript:void(0)">更多</a>
									                        </em>
									                        <ul id="ul${report.id!''}" class="morefloat" style="margin-left:-55px; width: 90px;text-align:left;display:none;">

									                            <li data-toggle="ajax" data-width="320" href="/${orgi}/user/report/${tabid}/shortcutadd/${report.id!''}.html" title="新建“${report.name!''}”快捷方式" style="width: 50px;">快捷方式</li>
									                            <li style="width: 50px;" onclick="addfavorite('${report.id!''}','${report.name!''}')">收藏</li>
									                        
									                            
									                        </ul>
									                    </div>
									                </div>
													</#if>
									                </#if>
													<div style="float: right;" >
													<!-- 1读/2编辑/3设置策略/4设计/5执行/6遍历/7计划任务 -->
													<#if report.reporttype?? && report.reporttype != 'shortcuts'>
														<#if report.isAllow("2",user) == true || report.isAllow("3",user) == true> 
														<a data-toggle="ajax" <#if report.reporttype?? && report.reporttype == 'plan'> href="/${orgi}/user/report/${tabid}/${report.dicid}/${report.id!''}/taskedit.html"  <#else> href="/${orgi}/user/report/${tabid}/reportproperties/${parentid!''}/${report.id!''}.html" </#if> title="设置属性">
															<i class="tbControlIcon tci-8"></i>
														</a>
														</#if>
														<#if report.reporttype?? && report.reporttype == 'plan' && report.isAllow("5",user) == true>
															<!--<i class="tbControlIcon tci-2"></i> -->
														</#if>
														<#if report.isAllow("4",user) == true && report.reporttype != 'plan'>
														<!--
														<a href="/${orgi}/design/analytics/${report.id!''}.html" target="design" title="使用自助查询设计器打开">
															<i class="tbControlIcon tci-108"></i>
														</a>
														-->
														<#if report.rolename?? && report.rolename == '1'>
														<a href="/${orgi}/design/analytics/${report.id!''}.html" target="design" title="使用自定义报表设计器打开">
															<i class="tbControlIcon tci-108"></i>
														</a>
														<#elseif report.rolename?? && report.rolename == 'dashboard'>
														<a href="/${orgi}/design/dashboard/${report.id!''}.html" target="design" title="使用仪表盘设计器打开">
															<i class="tbControlIcon tci-187"></i>
														</a>
														<#else>
														<a href="/${orgi}/design/query/${report.id!''}.html" target="design" title="使用自助查询设计器打开">
															<i class="tbControlIcon tci-107"></i>
														</a>
														</#if>
														</#if>
													</#if>
													<#if report.reporttype?? && report.reporttype == 'shortcuts'>
													<a data-toggle="ajax" <#if report.reporttype?? && report.reporttype == 'plan'> href="/${orgi}/user/report/${tabid}/${report.dicid}/${report.id!''}/taskedit.html"  <#else> href="/${orgi}/user/report/${tabid}/reportproperties/${parentid!''}/${report.id!''}.html" </#if> title="设置属性">
															<i class="tbControlIcon tci-8"></i>
													</a>
													<a onclick="art.prompt('请输入修改后的名称？' , function(value){location.href='/${orgi}/user/report/${tabid}/${parentid!''}/${report.id!''}/reportrename.html?name='+encodeURIComponent(value)} ,'${report.name!''}')" href="javascript:void(0)" title="修改报表名称"><i class="tbControlIcon tci-198"></i></a>
													</#if>
													<#if report.isAllow("2",user) == true>
													<a onclick="art.confirm('此操作将删除与此报表关联的报表和快捷方式，您确定要删除此报表吗？' , function(){location.href='/${orgi}/user/report/${tabid}/${parentid!''}/${report.id!''}/reportdelo.html'} , function(){})" href="javascript:void(0)" title="删除报表"><i class="tbControlIcon cbtn-icon-48"></i></a>
													</#if>
													</div>
													
												</td>
											</tr> 
											</#if>	
										</#if>	
									</#list>
 									</#if> 
								</tbody>
							</table>
							</form>
						</div>
					</div>
					<div class="rs_layout_bottom toolBar_bottom">
						<ul class="toolbarBottom_IconWrap">
							<#if dic?? && dic.spsearch == true>
							<li title="导入任务计划" class="cbtn-icon-task-41" href="/${orgi}/user/report/${tabid}/${parentid!''}/taskimport.html" data-width="600" id="taskimport" data-toggle="ajax"></li>
							<li title="导出计划任务" onclick="reportTaskExport()"  class="cbtn-icon-task-42"></li>
							<li title="导出报表" onclick="reportExportCheck()"  class="cbtn-icon-49"></li>
							<li title="导出报表" style="display: none;" id="reportExport" href="/${orgi}/user/report/${tabid}/reportexport.html" data-width="480" data-toggle="ajax" class="cbtn-icon-49"></li>
							<li title="复制报表" onclick="submitReportDoForm('reportcopy')" class="tb-icons-1"></li>
							<li title="移动报表" onclick="submitReportDoForm('reportmove')" class="tb-icons-2"></li>
							<li title="复制报表" href="/${orgi}/user/report/${tabid}/reportcopy.html" data-width="480" id="reportcopy" data-toggle="ajax" class="tb-icons-1" style="display: none"></li>
							<li title="移动报表" href="/${orgi}/user/report/${tabid}/reportmove.html" data-width="480" id="reportmove" data-toggle="ajax" class="tb-icons-2" style="display: none"></li>
							</#if>
							<li onclick="submitDelForm()" class="tb-icons-4"></li>
						</ul>
					</div>
				</div>
		
			</div>
		</div>
	</div>
</div>
</body>
</html>